package ${package}.utils;

import java.util.List;

public class MiscUtils {

	private MiscUtils() {
		// no constructor
	}

	/**
	 * 取出列表的第一个对象,如果列表为空,返回Null.
	 */
	static public <E> E uniqueOfList(List<E> list) {
		if (list == null || list.isEmpty())
			return null;
		if (list.size() > 1)
			throw new RuntimeException("the List size is more than 1");
		return list.get(0);
	}

}
